
/**   
 * @Title: UserInfoService.java 
 * @Package com.neusoft.neumooc.service 
 * @Description: TODO 
 * @author acer   
 * @date 2016年10月31日 上午9:50:02 
*/

package com.neusoft.neumooc.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.neusoft.core.common.exception.ServiceException;
import com.neusoft.core.util.IDUtil;
import com.neusoft.neumooc.VO.UserVO;
import com.neusoft.neumooc.dao.UserInfoDao;

/** 
 * @ClassName: UserInfoService 
 * @Description: TODO 
 * @author Fuyongjun
 * @date 2016年10月31日
 */
@Service
@Transactional
public class UserInfoServiceImpl  implements UserInfoService{
	@Autowired 
	UserInfoDao  userInfoDao;	
	/** 
	 * @Title: getUserCount 
	 * @Description: TODO 
	 * @return
	 * @throws ServiceException
	 */
	@Override
	public int getUserCount() throws ServiceException {
	
		return userInfoDao.getUserCount();
	}
	/** 
	 * @Title: getUsers 
	 * @Description: TODO 
	 * @param pageNo
	 * @param pageSize
	 * @return
	 * @throws ServiceException
	 */
	@Override
	public List<UserVO> getUsers(int pageNo, int pageSize)
			throws ServiceException {
		return userInfoDao.getUsers(pageNo, pageSize);
	}
	
	/** 
	 * @Title: InsertUsers 
	 * @Description: TODO 
	 * @param userVO
	 * @return
	 * @throws ServiceException
	 */
	
	@Override
	public int insertUsers(UserVO userVO) throws ServiceException {
		userVO.setId(IDUtil.getID());
		return  userInfoDao.insertUsers(userVO);
	}
	
	/** 
	 * @Title: checkRepeat 
	 * @Description: TODO 
	 * @param name
	 * @return
	 * @throws ServiceException
	 */
	
	@Override
	public boolean checkRepeat(String name) throws ServiceException {
		
		return userInfoDao.checkRepeat(name);
	}

}
